<!-- Contacts Starts
			================================================== --> 
<?php
/* CONTACT */
$page_contact = get_page_by_title( 'Contact' );
//var_dump($page_about);
//echo $page_home->ID;
$array_3_block_address = array();
if ( $page_contact ) {
    $page_contact_id = $page_contact->ID;
    //var_dump(get_field('background_image_'.$i, $page_about_id));
    for($i=1; $i<=4; $i++) {
        $array_temp = array();
        //title
        $title = get_field('title_'.$i, $page_contact_id);
        if($title)
            $array_temp['title'] = $title;
        //address info
        $address_info = get_field('address_info_'.$i, $page_contact_id);
        if($address_info)
            $array_temp['address_info'] = $address_info;
        //tel
        $tel = get_field('telephone_'.$i, $page_contact_id);
        if($tel)
            $array_temp['tel'] = $tel;
        //Fax
        $fax = get_field('fax_'.$i, $page_contact_id);
        if($fax)
            $array_temp['fax'] = $fax;
        //Email
        $email = get_field('email_'.$i, $page_contact_id);
        if($email)
            $array_temp['email'] = $email;
        if(count($array_temp) > 0)
            $array_3_block_address[] = $array_temp;
    }                                   
}
?>
		<section id="contact" class="white-bg">
				<h1 class="one"><span><?php echo (isset($page_contact->post_title)) ? $page_contact->post_title : ""?></span></h1>
                                
                <div class="page-banner">

            		<div class="container ">
                              <div class="center">
                                    <h3><?php echo (isset($page_contact->post_content)) ? $page_contact->post_content : ""?></h3>
                              </div>
                  	</div>
                </div>
            
             <div class="page-contents ">
            <div class="container">
                
				<!-- Form Starts -->
				<div class="row form-element">
					<div class="span12 center">
						<h2><span>DROP US A LINE</span></h2>
						<div class="done" <?php if(isset($_GET["contact_thanks"])) echo "style='display:block'"; ?>>
							<h3>Thank you ! We have received your message.</h3>
						</div>
					</div>
                                    <?php echo do_shortcode('[contact-form-7 id="96" title="Contact form 1_copy"]')?>

				</div>
				<!-- Form Ends-->
				<hr>
				<!-- Address Starts -->
				<div class="row">
					<div class="address">
                                        <?php
                                        //liust 3 block address
                                        if(count($array_3_block_address) > 0) :
                                            //foreach($array_3_block_address as $address) :
                                        ?>
                                                <div class="span4 medium-t-b-padding">
							<h2><?php echo (isset($address["title"])) ? $address["title"] : ""; ?></h2>
							<?php echo (isset($address["address_info"])) ? $address["address_info"] : ""; ?>
							<br />
							Tel: <?php echo (isset($address["tel"])) ? $address["tel"] : ""; ?> <br />
							Fax: <?php echo (isset($address["fax"])) ? $address["fax"] : ""; ?> <br />
							<br />
							Email: <a href="mailto:<?php echo (isset($address["email"])) ? $address["email"] : ""; ?>" target="_blank"><?php echo (isset($address["email"])) ? $address["email"] : ""; ?></a> 
						</div>
                                        <?php    
                                            //endforeach;
                                        endif;
                                        ?>
					</div>
				</div>
				<!-- Address Ends --> 
				<!-- Map Starts -->
				<div class="row">
					<div class="map">
						<div class="span12 medium-top-padding">
                                                    <?php
                                                    //show map
                                                    if( $page_contact_id ) {
                                                        echo get_field('google_map_code', $page_contact_id); 
                                                    }
                                                    ?>
						</div>
					</div>
				</div>
                                <div class="row">
					<div class="span12 center say-hello medium-top-padding">
						<?php
                                                //show last info block
                                                $title_last_block_contact = "";  $description_last_block_contact = "";
                                                if( $page_contact_id ) {
                                                    $title_last_block_contact = get_field('title', $page_contact_id); 
                                                    $description_last_block_contact = get_field('description', $page_contact_id); 
                                                }
                                                ?>
                                                <h2><span><?php echo $title_last_block_contact; ?></span></h2>
                                                <p class="lead"><?php echo $description_last_block_contact; ?></p>
					</div>
				</div>
				<!-- Map Ends --> 
				
                </div>
			</div>
			<!-- /container --> 
		</section>
		<!-- Contacts Ends
			================================================== --> 
                <!--BOOKING-->
        	<section id="booking" class="header white-bg">
                    <h1 class="one"><span>Book A Tour</span></h1>
                    <div class="page-contents ">
                        <div class="container">
                        <!-- Form Starts -->
                            <div class="row form-element">
                                <div class="span12 center">
                                    <div class="done">
					<h3>Thank you ! We have received your message.</h3>
                                    </div>
				</div>
                                <div class="form">
                                    <!--<form method="post" action="process.php">-->
                                    <?php echo do_shortcode('[contact-form-7 id="148" title="Booking A Tour"]');?>
                                        <!--<div class="span6">
                                            <input type="text" name="First name" class="text" placeholder="First Name *" style="width:94%"/>
                                            <input type="text" name="Last name" class="text"  placeholder="Last Name *" style="width:94%"/>
                                            <input type="text" name="Email" class="text" placeholder="Your Email *" style="width:94%"/>
                                            <input type="text" name="Number of tourist" class="text" placeholder="Number of tourist *" style="width:94%"/>
                                        </div>
                                        <div class="span6">
                                            <label class="desc" id="title106" for="Field106">Departure Date</label>
                                            <div>
                                                <select id="Field106" name="Month" class="field select medium"  tabindex="11" style="width:20%;" > 
                                                    <option value="January">January</option>
                                                    <option value="February">February</option>
                                                    <option value="March">March</option>
                                                </select>
                                                <input type="text" name="Day" class="text" placeholder="Day *" style="width:20%"/>
                                                <input type="text" name="Year" class="text" placeholder="Year *" style="width:20%"/>
                                            </div>
                                        </div>
                                        <div class="span6">
                                            <label class="desc" id="title106" for="Field106">Tour</label>
                                            <div>
                                                <select id="Field106" name="Province" class="field select medium"  tabindex="11" style="width:20%;" > 
                                                  <option value="Saigon">Saigon</option>
                                                  <option value="Nha Trang">Nha Trang</option>
                                                  <option value="Da Nang">Da Nang</option>
                                                </select>
                                                <select id="Field106" name="Tour" class="field select medium"  tabindex="11" style="width:20%;" > 
                                                  <option value="Saigon">One day Saigon</option>
                                                  <option value="Nha Trang">Saigon - My Tho</option>
                                                  <option value="Da Nang">Saigon - Nam Cat Tien</option>
                                                </select>
                                            </div>
                                        </div>    
                                        <div class="span12">
                                            <textarea name="comment" class="text textarea" placeholder="Notes " style="width:94%; height:100px;"></textarea>
                                        </div>
                                        <div class="span12 center">
                                            <p> 
                                                <h2 class="pricetxt">PRICE </h2> 
                                                <h1 class="price"> $150 </h1> 
                                            </p>
                                            <p>Click on SUBMIT button to deposit 50% price via paypal </p>                                            
                                        </div>
                                        <div class="span12 center">
                                            <input name="Submit" type="submit" class="btn btn-warning btn-large" id="submit" value="Submit" />
					</div>-->
                                    <!--</form>-->
                                </div>
                            </div>                            
                            <!-- Say Hello Starts -->
                            <div class="row">
                                <div class="span12 center say-hello medium-top-padding">                                    
                                    <!-- Social Icons Starts -->
                                    <ul class="ch-grid">
                                            <li>
                                                    <div class="ch-item">
                                                            <div class="ch-info">
                                                                    <div class="ch-info-front ch-img-1"></div>
                                                                    <div class="ch-info-back"> <img src="<?php bloginfo('template_url')?>/image/social-icons/facebook_dark.png" alt="" /> </div>
                                                            </div>
                                                    </div>
                                            </li>
                                            <li>
                                                    <div class="ch-item">
                                                            <div class="ch-info">
                                                                    <div class="ch-info-front ch-img-2"></div>
                                                                    <div class="ch-info-back"> <img src="<?php bloginfo('template_url')?>/image/social-icons/in_dark.png" alt="" /> </div>
                                                            </div>
                                                    </div>
                                            </li>
                                            <li>
                                                    <div class="ch-item">
                                                            <div class="ch-info">
                                                                    <div class="ch-info-front ch-img-3"></div>
                                                                    <div class="ch-info-back"> <img src="<?php bloginfo('template_url')?>/image/social-icons/twitter02_dark.png" alt="" /> </div>
                                                            </div>
                                                    </div>
                                            </li>
                                            <li>
                                                    <div class="ch-item">
                                                            <div class="ch-info">
                                                                    <div class="ch-info-front ch-img-4"></div>
                                                                    <div class="ch-info-back"> <img src="<?php bloginfo('template_url')?>/image/social-icons/dribbble_dark.png" alt="" /> </div>
                                                            </div>
                                                    </div>
                                            </li>
                                        </ul>
                                    <!-- Social Icons Ends --> 
                                    </div>
				</div>
				<!-- Say Hello Ends -->
				<hr>
				<!-- Copyright Start -->
				<div class="row">
					<div class="span12 copyright center"> © 2013 nugrafiz all rights reserved. </div>
				</div>
				<!-- Copyright Ends --> 
                        
                        
                        </div>
                    </div>
                </section>			

		<!-- Le javascript
			================================================== --> 
		<!-- Placed at the end of the document so the pages load faster --> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/jquery.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-transition.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-alert.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-modal.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-dropdown.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-scrollspy.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-tab.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-tooltip.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-popover.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-button.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-collapse.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-carousel.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-typeahead.js"></script> 
		<!--<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap.min.js" type="text/javascript"></script> --> 
		<script src="<?php bloginfo('template_url')?>/js/bootstrap/bootstrap-lightbox.min.js"></script> 
		<!-- Preloader
			================================================== -->  
		<script type="text/javascript">
			jQuery(window).load(function() {
			    $('.doc-loader').fadeOut('slow'); 
			    //displayHints();
			    //addTweets();	
				});
		</script>            
		<!-- Retina Support 
			================================================== -->                       
		<script src="<?php bloginfo('template_url')?>/js/retina/retina.js" type="text/javascript"></script>
        <!-- Twitter
			================================================== -->  
		<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> -->
		<script src="<?php bloginfo('template_url')?>/js/twitter/twitlive-min.js"></script> 
		<script>
			// Customize menu (Built for Envato preview)
			$(document).ready(function() {
				$(".customizeWindow").click(function() {
					$(".customizeMe").css("display", "block");
				});
				
				$("#close").click(function() {
					$(".customizeMe").css("display", "none");
				});
				
				$("#custSearch").click(function() {
					$(".customizeMe").css("display", "none");
					$("#tweet_box h1 em").html($("#keyword").val());
				});
				
				//$(".tweets").liveTweets({operator: "#envato", liveTweetsToken: "xNj9VrwKjCd5MKeSgLxt61H6fwxwX9555WOVaY8ev0"});
			});
		</script>              
		<!-- Social Likes 
			==================================================  
		<script type="text/javascript">
			(function() {
			  var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
			  po.src = 'https://apis.google.com/<?php bloginfo('template_url')?>/js/plusone.js';
			  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
			})();
		</script> -->
		<!-- AJAX Contact Form
			================================================== --> 
		<script type="text/javascript" src="<?php bloginfo('template_url')?>/js/contact/contact-form.js"></script> 
		<!-- Portfolio 
			================================================== --> 
		<script src="<?php bloginfo('template_url')?>/js/isotope/jquery.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/isotope/jquery.isotope.min.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/isotope/Isotope-Filtering.js"></script> 
		<!--custom scrollbar-->
		<!-- Custom Scrollbar 
			================================================== -->   
		<script src="<?php bloginfo('template_url')?>/js/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
		<script type="text/javascript">
			$(document).ready(function() {    
			$("html").niceScroll();  // The document page (body)
			
			
			
			});
		</script> 
		<!-- Supersized Slider
			================================================== --> 
		<script type="text/javascript" src="<?php bloginfo('template_url')?>/js/supersized/jquery.easing.min.js"></script> 
		<script type="text/javascript" src="<?php bloginfo('template_url')?>/js/supersized/supersized.3.2.7.min.js"></script> 
		<script type="text/javascript" src="<?php bloginfo('template_url')?>/js/supersized/supersized.shutter.min.js"></script> 
		<script type="text/javascript" src="<?php bloginfo('template_url')?>/js/supersized/supersized-images.js"></script> 		
		<!-- Scroll To
			================================================== --> 
		<!--<script src="jquery.js"></script>--> 
		<script src="<?php bloginfo('template_url')?>/js/nav/jquery.scrollTo.js"></script> 
		<script src="<?php bloginfo('template_url')?>/js/nav/jquery.nav.js"></script> 
		<script>
                        
			$(document).ready(function() {
				$('.nav').onePageNav({
				filter: ':not(.external)',
				scrollThreshold: 0.25
				});
                                   
                               <?php
                               /* HOME */
                               //get home slideshow image and text
                               $page_home = get_page_by_title( 'home' );
                               //echo $page_home->ID;
                               $array_json_slideshow_home = array();
                               if ( $page_home ) {
                                   $page_home_id = $page_home->ID;
                                   //var_dump(get_field('background_image_'.$i, $page_home_id));
                                   for($i=1; $i<=3; $i++) {
                                       $array_temp = array();
                                       //image
                                       $image = get_field('background_image_'.$i, $page_home_id);                                       
                                       if($image) {
                                           $array_temp['image'] = $image['url'];
                                           $array_temp['url'] = $image['url'];
                                       }
                                       //title
                                       $title = get_field('title_'.$i, $page_home_id);
                                       if($title)
                                           $array_temp['title'] = $title;
                                       //description
                                       $description = get_field('description_'.$i, $page_home_id);
                                       if($description)
                                           $array_temp['title'] = (isset($array_temp['title'])) ? $array_temp['title'] . '<div class="slidedescription">' . $description . '</div>' : $description;
                                       if(count($array_temp) > 0)
                                           $array_json_slideshow_home[] = $array_temp;
                                   }                                   
                               }
                               ?>
                               //big background
                               $.supersized({
				
					// Functionality
					slideshow               :   1,			// Slideshow on/off
					autoplay			:	1,			// Slideshow starts playing automatically
					start_slide             :   1,			// Start slide (0 is random)
					stop_loop			:	0,			// Pauses slideshow on last slide
					random			: 	0,			// Randomize slide order (Ignores start slide)
					slide_interval          :   3000,		// Length between transitions
					transition              :   1, 			// 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
					transition_speed		:	1000,		// Speed of transition
					new_window			:	1,			// Image links open in new window/tab
					pause_hover             :   0,			// Pause slideshow on hover
					keyboard_nav            :   1,			// Keyboard navigation on/off
					performance			:	1,			// 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
					image_protect		:	1,			// Disables image dragging and right click with Javascript
															   
					// Size & Position						   
					min_width		       :   0,			// Min width allowed (in pixels)
					min_height		       :   0,			// Min height allowed (in pixels)
					vertical_center         :   1,			// Vertically center background
					horizontal_center       :   1,			// Horizontally center background
					fit_always			:	0,			// Image will never exceed browser width or height (Ignores min. dimensions)
					fit_portrait         	:   1,			// Portrait images will not exceed browser height
					fit_landscape		:   0,			// Landscape images will not exceed browser width
															   
					// Components							
					slide_links				:	'blank',	// Individual links for each slide (Options: false, 'num', 'name', 'blank')
					thumb_links				:	1,			// Individual thumb links for each slide
					thumbnail_navigation    :   0,			// Thumbnail navigation
					/*slides 					:  	[			// Slideshow Images
														{image : '<?php bloginfo('template_url')?>/image/slider/1.jpg', title : 'Community<div class="slidedescription">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>', thumb : '', url : '<?php bloginfo('template_url')?>/image/slider/1.jpg'},
														{image : '<?php bloginfo('template_url')?>/image/slider/2.jpg', title : 'Environment<div class="slidedescription">Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam.</div>', thumb : '', url : '<?php bloginfo('template_url')?>/image/slider/2.jpg'}
												],*/
                                        slides : <?php echo json_encode($array_json_slideshow_home); ?>,   
												
					// Theme Options			   
					progress_bar			:	1,			// Timer for each slide							
					mouse_scrub				:	0
					
				});
                                
                                
                                <?php 
                                if(is_single()) :
                                ?>
                                    function resize_video_for_wh() {
                                        if($("#hidden_video_url").length > 0) {
                                            var div_width = $(".content .container .span8").width();
                                            var div_height = $(".content .container .span8").height();
                                            var video_html = $("#hidden_video_url").val();
                                            //alert(video_html);
                                            video_html = video_html.replace('f_width', div_width);
                                            video_html = video_html.replace('f_height', div_width / 2);
                                            //alert(video_html);
                                            $("#thumbnail_video_image").html(video_html);
                                        }
                                    }
                                    
                                    resize_video_for_wh();
                                       
                                    //alert(div_width);
                                    
                                    /*$(window ).resize(function() {
                                        //alert(23456);
                                        resize_video_for_wh();
                                    });*/
                                <?php
                                endif;
                                ?>
                               if($(".wpcf7-mail-sent-ok").length > 0) {
                                    $(".wpcf7-mail-sent-ok").hide();
                                    $(".done").css({'display' : 'block'});
                                }                                
			});                        
		</script> 
	<?php wp_footer(); ?>	
	</body>
</html>